Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

acorn-dynamic-import

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

acorn-dynamic-import

Support dynamic imports in acorn

  • 4.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is acorn-dynamic-import?

The acorn-dynamic-import package is a plugin for the Acorn JavaScript parser that adds support for parsing dynamic import() syntax. This allows developers to use the import() function to dynamically load modules in their JavaScript code, which can be useful for code splitting and lazy loading.

What are acorn-dynamic-import's main functionalities?

Parsing dynamic import() syntax

This feature allows the Acorn parser to understand and parse the dynamic import() syntax. The code sample demonstrates how to extend the Acorn parser with the acorn-dynamic-import plugin and parse a piece of JavaScript code that uses dynamic import().

const acorn = require('acorn');
const dynamicImport = require('acorn-dynamic-import').default;

const Parser = acorn.Parser.extend(dynamicImport);

const code = 'import("./module.js").then(module => { console.log(module); });';
const ast = Parser.parse(code, { ecmaVersion: 2020 });

console.log(ast);

Other packages similar to acorn-dynamic-import

FAQs

Package last updated on 01 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc